home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 July / CHIP 2006-07.2.iso / program / web_gelistirme / easyphp1-7_setup.exe / {app} / phpmyadmin / server_processlist.php < prev    next >
Encoding:
PHP Script  |  2003-09-07  |  3.7 KB  |  100 lines

  1. <?php
  2. /* $Id: server_processlist.php,v 1.7 2003/03/27 21:39:23 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Does the common work
  8.  */
  9. require('./server_common.inc.php');
  10.  
  11.  
  12. /**
  13.  * Kills a selected process
  14.  */
  15. if (!empty($kill)) {
  16.     $sql_query = 'KILL ' . $kill . ';';
  17.     if (@PMA_mysql_query($sql_query, $userlink)) {
  18.         $message = sprintf($strThreadSuccessfullyKilled, $kill);
  19.     } else {
  20.         $message = sprintf($strCouldNotKill, $kill);
  21.     }
  22. }
  23.  
  24.  
  25. /**
  26.  * Displays the links
  27.  */
  28. require('./server_links.inc.php');
  29.  
  30.  
  31. /**
  32.  * Displays the sub-page heading
  33.  */
  34. echo '<h2>' . "\n"
  35.    . '    ' . $strProcesslist . "\n"
  36.    . '</h2>' . "\n";
  37.  
  38.  
  39. /**
  40.  * Sends the query and buffers the result
  41.  */
  42. $serverProcesses = array();
  43. $sql_query = 'SHOW' . (empty($full) ? '' : ' FULL') . ' PROCESSLIST;';
  44. $res = @PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
  45. while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC)) {
  46.     $serverProcesses[] = $row;
  47. }
  48. @mysql_free_result($res);
  49. unset($res);
  50. unset($row);
  51.  
  52.  
  53. /**
  54.  * Displays the page
  55.  */
  56. ?>
  57. <table border="0">
  58.     <tr>
  59.         <th><?php echo PMA_MYSQL_INT_VERSION < 32307 ? '' : '<a href="./server_processlist.php?'. $url_query . (empty($full) ? '&full=1' : '') . '" title="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '"><img src="./images/' . (empty($full) ? 'full' : 'partial') . 'text.png" width="50" height="20" border="0" alt="' . (empty($full) ? $strShowFullQueries : $strTruncateQueries) . '" /></a>';  ?></th>
  60.         <th> <?php echo $strId; ?> </th>
  61.         <th> <?php echo $strUser; ?> </th>
  62.         <th> <?php echo $strHost; ?> </th>
  63.         <th> <?php echo $strDatabase; ?> </th>
  64.         <th> <?php echo $strCommand; ?> </th>
  65.         <th> <?php echo $strTime; ?> </th>
  66.         <th> <?php echo $strStatus; ?> </th>
  67.         <th> <?php echo $strSQLQuery; ?> </th>
  68.     </tr>
  69. <?php
  70. $useBgcolorOne = TRUE;
  71. while (list($name, $value) = each($serverProcesses)) {
  72. ?>
  73.     <tr>
  74.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <a href="./server_processlist.php?<?php echo $url_query . '&kill=' . $value['Id']; ?>"><?php echo $strKill; ?></a> </td>
  75.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Id']; ?> </td>
  76.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['User']; ?> </td>
  77.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Host']; ?> </td>
  78.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['db']) ? '<i>' . $strNone . '</i>' : $value['db']); ?> </td>
  79.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo $value['Command']; ?> </td>
  80.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right"> <?php echo $value['Time']; ?> </td>
  81.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['State']) ? '---' : $value['State']); ?> </td>
  82.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>"> <?php echo (empty($value['Info']) ? '---' : PMA_SQP_formatHtml(PMA_SQP_parse($value['Info']))); ?> </td>
  83. <?php
  84.     $useBgcolorOne = !$useBgcolorOne;
  85. }
  86. ?>
  87.     </tr>
  88. <?php
  89. ?>
  90. </table>
  91. <?php
  92.  
  93.  
  94. /**
  95.  * Sends the footer
  96.  */
  97. require('./footer.inc.php');
  98.  
  99. ?>
  100.